﻿using Gamelight.Data;

namespace Gamelight.Sound
{
	public class Sound
	{
		private string assembly;
		private string path;
		private GamelightMediaStream mediaStream;

		public Sound(string assembly, string path)
		{
			this.path = path;
			this.assembly = assembly;
			this.mediaStream = Resources.GetMediaStream(this.assembly, this.path);
		}

		public Sound(string path) : this(null, path) { }

		internal System.IO.Stream MediaStream
		{
			get
			{
				return this.mediaStream.GetNewStream();
			}
		}

		internal bool Matches(Sound anotherSound)
		{
			return anotherSound.assembly == this.assembly &&
				anotherSound.path == this.path;
		}
	}
}